﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Restaurant
{
    public partial class frmAdmin : Form
    {
        User_Control.ThongKeNH usThongKeNH = new User_Control.ThongKeNH();
        User_Control.ThongKeNV usThongKeNV = new User_Control.ThongKeNV();
        public bool fix = false;
        public bool unrepeat = false;
        public bool phantom = false;
        int NH = 1;
        int NV = 1;
        public frmAdmin()
        {
            InitializeComponent();
        }

        private void btnNH_Click(object sender, EventArgs e)
        {
            pnMain.Controls.Clear();
            if (NH == 1)
            {
                usThongKeNH.fix = fix;
                usThongKeNH.unrepeat = unrepeat;
                usThongKeNH.phantom = phantom;
                pnMain.Controls.Add(usThongKeNH);
                NH = 0;
                return;
            }
            if (NH == 0)
            {
                pnMain.Controls.Clear();
                NH = 1;
                return;
            }
        }

        private void btnNV_Click(object sender, EventArgs e)
        {
            pnMain.Controls.Clear();
            if (NV == 1)
            {
                usThongKeNV.fix = fix;
                usThongKeNV.unrepeat = unrepeat;
                usThongKeNV.phantom = phantom;
                pnMain.Controls.Add(usThongKeNV);
                NV = 0;
                return;
            }
            if (NV == 0)
            {
                pnMain.Controls.Clear();
                NV = 1;
                return;
            }
        }

        private void loi_unrepeat_CheckedChanged(object sender, EventArgs e)
        {
            if (loi_unrepeat.Checked)
            {
                unrepeat = true;
            }
            else
            {
                unrepeat = false;
            }
        }

        private void loi_phantom_CheckedChanged(object sender, EventArgs e)
        {
            if (loi_phantom.Checked)
            {
                phantom = true;
            }
            else
            {
                phantom = false;
            }
        }

        private void fix_loi_CheckedChanged(object sender, EventArgs e)
        {
            if (fix_loi.Checked)
            {
                fix = true;
            }
            else
            {
                fix = false;
            }
        }
    }
}
